﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Model;
using System.Data.Objects;

namespace DAL
{
    public class BaseDAL_OA <T> where T:class
    {
        ZG_OAEntities ds = new ZG_OAEntities();
       
        public ObjectSet<T> GetAll()
        {
            return ds.CreateObjectSet<T>();
        }

        public void Add(T t)
        {
            GetAll().AddObject(t);
        }

        public void Delete(T t)
        {
            GetAll().DeleteObject(t);
        }

        public void SaveChanges()
        {
            ds.SaveChanges();
        }
    }
}
